mergeInto(LibraryManager.library, { 
    SetLocalStorage: function (key, value) {  
        console.log("set:"+UTF8ToString(key))
        window.localStorage.setItem(UTF8ToString(key), UTF8ToString(value));  
    },  
    GetLocalStorage: function (key) {  
        var returnStr = window.localStorage.getItem(UTF8ToString(key));
        
        var bufferSize = lengthBytesUTF8(returnStr) + 1;
        var buffer = _malloc(bufferSize);
        stringToUTF8(returnStr, buffer, bufferSize);
        return buffer;
    },  
    RemoveLocalStorage: function (key) {  
        window.localStorage.removeItem(UTF8ToString(key));  
    }   
});
